<script src="${base!}/assets/platform/vendor/ueditor/ueditor.config.js"></script>
<script src="${base!}/assets/platform/vendor/ueditor/ueditor.all.js"></script>
<div class="modal-body no-p">
    <h4 class="modal-title" id="adoptLabel">套用现有页面 </h4>
    <div class="row">
        <div class="col-xs-12">
            <section class="panel panel-form">
                <form id="saveReportForm" role="form" class="form-horizontal parsley-form form-bordered form-validate1" data-parsley-validate
                      action="${base}/platform/dec/templates/pages/adoptPage" method="post" enctype="multipart/form-data" class='form-bordered form-validate' onsubmit="return saveReport();">
                    <div class="row mb10 mt10">
                        <div class="col-lg-12">
                            <div class="form-group" hidden="hidden">
                                <label for="templateUuid" class="col-sm-2 control-label">${msg['dec.templates.pages.column.templateUuid']}</label>
                                <div class="col-sm-8">
                                    <input type="text" id="templateUuid" class="form-control" name="templateUuid" data-parsley-required="true" placeholder="${msg['dec.templates.pages.column.templateUuid']}" value="${obj.templateUuid}">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label for="templateUuid" class="col-sm-2 control-label">所选页面</label>
                                <div class="col-sm-8">
                                    <input type="text" id="" class="form-control" name="" data-parsley-required="true" readOnly="readOnly" value="${obj.pageName}">
                                </div>
                            </div>
                            <!--   <div class="form-group">
                                   <label for="pageNo" class="col-sm-2 control-label">${msg['dec.templates.pages.column.pageNo']}</label>
                                   <div class="col-sm-8">
                                   <input type="text" id="pageNo" class="form-control" name="pageNo" data-parsley-required="true" placeholder="${msg['dec.templates.pages.column.pageNo']}">
                                   </div>
                               </div>-->
                            <div class="form-group">
                                <label for="pageName" class="col-sm-2 control-label">${msg['dec.templates.pages.column.pageName']}</label>
                                <div class="col-sm-8">
                                    <input type="text" id="pageName" class="form-control" name="pageName" data-parsley-required="true" placeholder="${msg['dec.templates.pages.column.pageName']}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="pageFileName" class="col-sm-2 control-label">${msg['dec.templates.pages.column.pageFileName']}</label>
                                <div class="col-sm-8">
                                    <input type="text" id="pageFileName" class="form-control" name="pageFileName" data-parsley-required="true" data-parsley-minlength="6" data-parsley-maxlength="20" data-parsley-htmlname="true" placeholder="${msg['dec.templates.pages.column.pageFileName']}" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="pageType" class="col-sm-2 control-label">${msg['dec.templates.pages.column.pageType']}</label>
                                <div class="col-sm-8">
                                    <select id="pageType" class="select2-me form-control" name="pageType" data-parsley-required="true">
                                        <option value="">-请选择-</option>>
                                        <option value="1">首页 </option>
                                        <option value="2">商品列表页</option>
                                        <option value="3">商品详情页</option>
                                        <option value="4">自定义页</option>
                                        <option value="5">频道页</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="description"  class="col-sm-2 control-label">${msg['dec.templates.pages.column.description']}</label>
                                <div class="col-sm-8">
                                    <textarea type="text" id="description" class="form-control" name="description" data-parsley-required="true" placeholder="${msg['dec.templates.pages.column.description']}"  data-rule-maxlength="200"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3"></div>
                        <div class="col-lg-6">
                            <div class="form-group text-center">
                                <label></label>
                                <div>
                                    <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="${msg['globals.button.submit.tip']}">${msg['globals.button.submit']}</button>
                                </div>
                            </div>
                        </div>
                </form>
            </section>
        </div>
    </div>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        $('#saveReportForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    form.resetForm();
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>